home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / collide.z / collide
Text File  |  1998-10-30  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4. CCCCOOOOLLLLLLLLIIIIDDDDEEEE((((1111))))                                                          CCCCOOOOLLLLLLLLIIIIDDDDEEEE((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      collide - look for name collisions between libraries
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ccccoooolllllllliiiiddddeeee [-l] [-d] [-w] _f_i_l_e  ...
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      When porting a large application a critical question is ``How do I know
  16.      if names in this application conflict with names in libraries I must
  17.      use?''  _C_o_l_l_i_d_e answers that question by finding name collisions across
  18.      archive libraries and object files.  It treats a Dynamic Shared Object
  19.      (dso) as if it were an archive library.
  20.  
  21.      Given a list of files, _c_o_l_l_i_d_e finds all duplicate external names and
  22.      writes those names to standard output.  There is no output if there are
  23.      no conflicts.
  24.  
  25.      The ----llll (longform) option adds the object file names to the output; these
  26.      are occasionally interesting.  This must be the first option to _c_o_l_l_i_d_e
  27.      if it is specified at all.
  28.  
  29.      The ----dddd (show duplicates) option reports duplicate external names on
  30.      standard error.  This reports the same problems _a_r would if run on the
  31.      same object files but in more detail.  ----dddd applies to object files, not
  32.      archive libraries.
  33.  
  34.      The ----wwww (weak symbol) option treats weak symbols the same as normal
  35.      external symbols.  By default weak symbols are ignored in the search for
  36.      duplicates.
  37.  
  38.      The _f_i_l_es named may be either archive libraries or object files.  A list
  39.      of object files is gathered together (by /_u_s_r/_l_i_b/_c_o_l_l_i_d_e_1) just as is
  40.      done by _a_r(1).  Gathering of a list of objects stops when an archive name
  41.      is seen.  Object gathering is important because a _c_o_m_m_o_n declaration may
  42.      appear in multiple files yet it does not reflect a name duplication.
  43.  
  44.      _C_o_l_l_i_d_e is a shell script that uses /_u_s_r/_l_i_b/_c_o_l_l_i_d_e_1 to extract the
  45.      public symbols from each archive (or gathered collection of objects) and
  46.      notes the object file name and archive name along with the symbol.  You
  47.      may find it useful to find which library or object contains a name, (the
  48.      name may be a weak symbol).  For example, the following do roughly the
  49.      same thing:
  50.  
  51.          /usr/lib/collide1 -w /usr/lib/libc.a | grep strcpy
  52.          nm -Bo /usr/lib/libc.a | grep strcpy
  53.  
  54.  
  55.      If there are too many objects to list them all on the command line, use
  56.      the _a_r(1) command to build an archive.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCOOOOLLLLLLLLIIIIDDDDEEEE((((1111))))                                                          CCCCOOOOLLLLLLLLIIIIDDDDEEEE((((1111))))
  71.  
  72.  
  73.  
  74.      Examples:
  75.  
  76.          cd /usr/lib
  77.          collide libgl_s.a libc.a libcps.a /tmp/mylib.a
  78.          cd /usr/tmp
  79.          # a.o b.o treated as if in archive "none".
  80.          # c.o d.o treated as if in a separate archive "none".
  81.          collide -d a.o b.o /usr/lib/libc.a c.o d.o
  82.  
  83.          ar cr mylib.a *.o
  84.          collide  mylib.a /usr/lib/libc.a
  85.  
  86.          # Not useful. All the externals are collisions.
  87.          collide libc_s.a libc.a
  88.  
  89.  
  90. FFFFIIIILLLLEEEESSSS
  91.      /usr/sbin/collide
  92.      /usr/lib/collide1
  93.  
  94. NNNNOOOOTTTTEEEESSSS
  95.      The format of a line written by _c_o_l_l_i_d_e_1 is:
  96.  
  97.          variable-name objectfile-name archive-name
  98.  
  99.  
  100.      Each name is separated by a tab; the line ends with a newline.  There are
  101.      no blanks or extraneous characters in the output.
  102.  
  103.      If you supply object names to _c_o_l_l_i_d_e it is a good idea to use the ----dddd
  104.      option.
  105.  
  106.      While the C language does not have FORTRAN _c_o_m_m_o_n declarations per se,
  107.      the declaration int c; will, if it appears outside of any function
  108.      declaration be marked in the symbol table as _c_o_m_m_o_n (with Traditional C
  109.      only - not with ANSI C).
  110.  
  111. NNNNOOOOTTTTEEEESSSS
  112.      _c_o_m_m_o_n declarations which appear in different archives can cause false
  113.      reports of duplications. This should not happen if you put all your
  114.      objects in a single archive or list all your objects together on the
  115.      command line.
  116.  
  117.      _c_o_l_l_i_d_e recognizes an object as a dso by looking for names ending in ....ssssoooo
  118.      or ....ssssoooo....<<<<NNNN>>>> (where <<<<NNNN>>>> is a number, as in ....ssssoooo....1111) so dso's not named that
  119.      way are treated as simple object files.
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.